home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
program
/
331
/
gemfsc14
/
aessrc14
/
aesutrs2.s
< prev
next >
Wrap
Text File
|
1990-05-26
|
3KB
|
81 lines
;*========================================================================
;*
;* AESFAST Public Domain GEM bindings.
;*
;* 05/26/90 v1.4
;* Added handling of ICON objects.
;* 09/18/89 v1.3
;* Added code to handle INDIRECT objects.
;*========================================================================
;*************************************************************************
;*
;* AESUTRS2.S - Resource-related Utilities 2 of n.
;* Non-standard utility functions.
;*
;*************************************************************************
.include "gemfast.sh"
;-------------------------------------------------------------------------
; rsc_gstrings - Get pointers to strings within a tree.
;
; This function gets one or more string pointers from within
; a resource tree. It knows the difference between strings
; and buttons and text objects, and gets the ob_spec or
; te_ptext pointer as appropriate. It accepts a variable
; number of object/pointer pairs, with a negative object
; index indicating the end of the list.
;
; In this function, ptr1, ptr2, etc are the addresses of
; the pointers you want to initialize...
; void rsc_sstrings(tree, obj1,ptr1 [,obj2,ptr2,...,objn,ptrn], -1);
;-------------------------------------------------------------------------
_rsc_gstrings::
.cargs #12,.ptree.l,.parms
movem.l a2-a3,-(sp) ; Save Laser C register.
move.l .ptree(sp),a3
lea .parms(sp),a2
.loop:
move.w (a2)+,d2
bmi.s .done
move.l (a2)+,a0
muls #OBJ_SIZ,d2
lea ob_spec(a3,d2.l),a1 ; Get ob_spec.
btst.b #0,ob_flags(a3,d2.l); Is INDIRECT flag set?
beq.s .notind ; Nope, ob_spec is all set.
move.l (a1),a1 ; Yep, get real ob_spec.
.notind:
move.w ob_type(a3,d2.l),d1 ; Get ob_type.
cmp.b #G_ICON,d1
beq.s .icon
cmp.b #G_TEXT,d1
beq.s .text
cmp.b #G_BOXTEXT,d1
beq.s .text
cmp.b #G_FTEXT,d1
beq.s .text
cmp.b #G_FBOXTEXT,d1
bne.s .string
.icon:
move.l (a1),a1 ; For ICON, ob_spec points to
lea 12(a1),a1 ; iconblk, text ptr is iconblk+12.
bra.s .string
.text:
move.l (a1),a1 ; Get te_ptext
.string:
move.l (a1),(a0)
bra.s .loop
.done:
movem.l (sp)+,a2-a3 ; Restore Laser C register.
rts
; end of code